package org.dinesh.synchronoss;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;

public class DirectoryContents {
	String separator = "----->";
	String space     = "      ";
	public static void main(String[] args) {
		File f = new File("C:/DINESH/My Files/Songs");
		new DirectoryContents().printDetails(f);
	}
	
	
	private void printDetails(File file) {
		ArrayList<File> files = new ArrayList<File>(
				Arrays.asList(file.listFiles()));
		for (File fileData : files) {
			if (fileData.isDirectory()) {
				System.out.println(separator+fileData.getName());
				printDetails(fileData);
			}
			else{
				if (fileData.getName().indexOf(".mp3")>0) {
					System.out.println(space+fileData.getName());
				}
			}
		}
	}
}
